const cloud = require('wx-server-sdk');

cloud.init({
  env: "cloud1-0gkscant58767519"
});
const db = cloud.database();

// 修改数据库信息云函数入口函数
exports.main = async (event, context) => {
 return await db.collection('user').add({
     data:{
         nickName:event.data.nickName,
         openid:event.data.openid,
         avatarUrl:event.data.avatarUrl

     }
 });
};
